<div class='panel'>
  <div class='header'>
    <span class='col_fade'>编辑标签</span>
    <span class='col_right close'>x</span>
  </div>
  <div class='inner'>
    <% if(locals.edit_error){ %>
    <div class="alert alert-error">	
      <a class="close" data-dismiss="alert" href="#">&times;</a>
      <strong><%= edit_error %></strong>
    </div>
    <% } %>
    <form id='edit_tag_form' class='form-horizontal' action='/list/<%= list._id %>' method='post'>
      <legend></legend>
      <div class='control-group'>
        <label class='control-label' for='name'>名字</label>
        <div class='controls'>
          <input class='input-xlarge' id='name' name='name' size='30' type='text' value='<%= list.name %>'/>
          <p class='help-block'>须为汉字和字母和数字组合</p>
        </div>
      </div>
      <div class='control-group'>
        <label class='control-label' for='tag'>序号</label>
        <div class='controls'>
          <select class='span2' name='tag'>
            <% locals.tags && tags.forEach(function(tag) { %>
            <% if (list.tag_id.toString() == tag._id.toString()) { %>
            <option value='<%= tag._id %>' selected='selected'><%= tag.name %></option>
            <% } else { %>
            <option value='<%= tag._id %>'><%= tag.name %></option>
            <% } %>
            <% }); %>
          </select>
          <p class='help-block'>选择分类的标签</p>
        </div>
      </div>
      <div class='control-group'>
        <label class='control-label' for='desc'>描述</label>
        <div class='controls'>
          <textarea class='input-xlarge' id='desc' name='desc' rows='4'><%= list.desc %></textarea>
        </div>
      </div>
      <input type='hidden' name='_csrf' value='<%= csrf %>' />
      <div class='form-actions'>
        <input type='submit' class='btn' value='保存' />
        <a class='delete_tag_btn' href='/list/<%= list.name %>/delete'><input type='button' class='btn' value='删除' /></a>
      </div>
    </form>
  </div>
</div>
